<template>
  <div class="container">
    <h1 class="title">请注册您的信息</h1>
    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="ruleForm">
        <el-form-item prop="username" required>
            <el-input type="text" v-model="ruleForm.username" placeholder="请输入用户名" size="medium" name="username" prefix-icon="el-icon-location">
              <template slot="prepend">用户名</template>
            </el-input>
        </el-form-item>
        <el-form-item prop="pwd" required>
            <el-input type="text" v-model="ruleForm.pwd" placeholder="请输入密码" size="medium" name="password" prefix-icon="el-icon-location">
              <template slot="prepend">密&nbsp;&nbsp;&nbsp;&nbsp;码</template>
            </el-input>
        </el-form-item>
        <el-form-item prop="checkPwd" required>
            <el-input type="text" v-model="ruleForm.checkPwd" placeholder="请再次输入密码" disabled="" size="medium" prefix-icon="el-icon-location">
              <template slot="prepend">确&nbsp;&nbsp;&nbsp;&nbsp;认</template>
            </el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" round plain :loading="loading" @click="toRouter('/project')">提&nbsp;&nbsp;&nbsp;&nbsp;交</el-button>
        </el-form-item>
    </el-form>
  </div>
</template>
<script>
import { toRouter } from "../api/common/common";
export default {
  data() {
    return {
      ruleForm: {
        username: "",
        pwd: "",
        checkPwd: ""
      },
      rules: {
        username: [
          {
            message: "请输入用户名，长度5-25字节",
            trigger: "focus"
          },
          {
            required: true,
            message: "请输入用户名",
            trigger: "blur"
          },
          {
            min: 5,
            max: 25,
            message: "用户名长度5-25字节",
            trigger: "blur"
          }
        ],
        pwd: [
          {
            required: true,
            message: "请输入用户名",
            trigger: "blur"
          }
        ],
        checkPwd: [
          {
            required: true,
            message: "请输入用户名",
            trigger: "blur"
          }
        ]
      },
      loading: false,
      toRouter: toRouter
    };
  },
  methods: {
    userPass() {},
    pwdPass() {},
    checkPwdPass() {}
  }
};
</script>
<style lang="stylus" scoped rel="stylesheet/stylus">
.container
  width 400px
  margin 0 auto
  text-align center
  padding-top 230px
  .title
    font-weight 700
    padding 20px
    letter-spacing 5px
    color white
</style>
